package pATT.visualize;

import javax.swing.JPanel;

import pATT.bNEdit.gui.BNEditInternalFrame;
import pATT.bNEdit.gui.BNEditMainFrame;
import pATT.profilingAlgorithm.ProfilingAlgorithm;
import pATT.profilingAlgorithm.SAVERAlgorithm;





public class SAVERVisualize extends VisualizeAlgorithm {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private BNEditInternalFrame bayesFrame = null;

	@Override
	public JPanel visualizeProfile(ProfilingAlgorithm algorithm)
	throws Exception {
		SAVERAlgorithm algo = (SAVERAlgorithm)algorithm;

		bayesFrame = new BNEditInternalFrame(algo.getNet(), algo.getNetBayesPath(), new BNEditMainFrame());

		return (JPanel)bayesFrame.getContentPane();

	}

	@Override
	public boolean canSave() {
		return true;
	}

	public JPanel getPanelVisualize(){
		if(bayesFrame != null){
			return bayesFrame.getNetView();
		}
		return null;
	}

}
